<template>
  <div>
    <div class="title">
      热门推荐
    </div>
    <ul>
      <router-link tag="li" class="item border-bottom" v-for="item of list" :key="item.id" :to="'/detail/' + item.id">
        <img class="item-img" :src="item.imgUrl" />
        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
          <button class="item-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: Array
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/mixins.styl'
  .title
    margin-top 10px
    line-height 40px
    background #eee
    text-indent 10px
  .item
    display flex
    height 95px
    overflow hidden
    .item-img
      width 85px
      height 85px
      padding 5px
    .item-info
      flex 1
      padding 5px
      min-width 0px
      .item-title
        line-height 24px
        font-size 16px
        ellipsis()
      .item-desc
        line-height 20px
        color #ccc
        font-size 14px
        ellipsis()
      .item-button
        background #ff9300
        padding 5px
        line-height 22px
        border-radius 3px
        margin-top 5px
        color #fff
</style>
